/**
 * File    : OpenIDProvider.java
 * Created : 2008-10-5
 * By      : LuHuiguo
 */
package com.luhuiguo.sso.provider;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.openid4java.message.ParameterList;

/**
 * @author LuHuiguo
 * @version $Id: OpenIDProvider.java 7 2008-10-06 03:46:38Z LuHuiguo $
 * 
 */
public interface OpenIDProvider {

	public static final String OPENID_AUTHENTICATION_REQUEST = (new StringBuilder())
			.append(OpenIDProvider.class.getName()).append(".openid.auth.request")
			.toString();

	void processOpenIDRequest(HttpServletRequest request,
			HttpServletResponse response) throws IOException, ServletException,
			OpenIDException;

	void associate(HttpServletRequest request, HttpServletResponse response,
			ParameterList requestParameters) throws IOException;

	void checkAuthentication(HttpServletRequest request,
			HttpServletResponse response, ParameterList requestParameters)
			throws IOException, OpenIDException;

	void checkImmediateAuthentication(HttpServletRequest request,
			HttpServletResponse response, ParameterList requestParameters)
			throws IOException, OpenIDException;

	void sendAuthenticationResponse(HttpServletRequest request,
			HttpServletResponse response, OpenIDAuthResponse authResp)
			throws IOException;

	void verifyAuthentication(HttpServletRequest request,
			HttpServletResponse response, ParameterList requestParameters)
			throws IOException;

}
